package main

import (
	"bufio"
	"fmt"
	"os"
	"runtime"
	"time"
)

func test() {
	var inputReader *bufio.Reader
	fmt.Printf("num of goroutine: %d\n", runtime.NumGoroutine())
	inputReader = bufio.NewReader(os.Stdin)
	_, _ = inputReader.ReadString('\n')
}

func main() {
	fmt.Println("start, left 10s to confirm")
	fmt.Printf("cpus:%d\n", runtime.NumCPU())
	time.Sleep(10 * time.Second)
	for i := 0; i < 100000; i++ {
		if i%1000 == 0 {
			time.Sleep(1 * time.Second)
		}
		go test()
	}
	time.Sleep(10 * time.Second)
	fmt.Println("main exit")

}
